/*
2021-7-27
https://www.acwing.com/problem/content/3785/
*/
#include<cstring>
#include<iostream>
#include<algorithm>

using namespace std;
typedef long long ll;
const int N=1e5+5;
int x[N],y[N];
int n;

ll get(int x[])
{
    ll sum1=0,sum2=0;
    for(int i=0;i<n;i++)
    {
        sum1+=(ll)x[i]*x[i];
        sum2+=x[i];
    }
    return n*sum1-sum2*sum2;
}

int main()
{
    cin>>n;
    
    for(int i=0;i<n;i++)
    {
       cin>>x[i]>>y[i]; 
    }
    
    cout<<get(x)+get(y)<<endl;
    
    return 0;
}

